# request 中包含请求中的所有参数
from flask import  Flask,render_template,request

app = Flask(__name__)

@app.route('/index',methods=['GET','POST'])
def index():
    # '判断是get请求‘
    if request.method == "GET":
        return render_template('index.html')
    # '判断是post请求'
    if request.method == 'POST':
        name = request.form.get('name')
        password = request.form.get('password')
        print(name,password)
        return 'this is post'

if __name__ == '__main__':
    app.run()